package com.yvon.maple.cloud.web.config;

import com.yvon.maple.cloud.web.filter.FeignInsideFilter;
import com.yvon.maple.cloud.web.filter.FeignRequestInterceptor;
import com.yvon.maple.cloud.web.handler.HttpHandler;
import feign.RequestInterceptor;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * feign自动配置
 *
 * @author : Yvon
 * @since : 2021-08-25
 */
@Configuration
@EnableFeignClients(basePackages = {"com.yvon.maple.cloud.api"})
public class FeignAutoConfig {

    @Bean
    public RequestInterceptor getRequestInterceptor() {
        return new FeignRequestInterceptor();
    }

    @Bean
    public FeignInsideFilter feignInsideFilter(){
        return new FeignInsideFilter();
    }

}
